package myPack.GMAO.Entity;

import java.util.Date;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;


@Entity
@DiscriminatorValue("Emp")
public class Employer extends Acteur
{	
	private static final long serialVersionUID = 1L;
	
	private String prenom;
    private String CIN;
    private String photo;
    private Date dateN;
    
    @ManyToOne @JoinColumn(referencedColumnName="mat",name="res")
    private Employer res;
    
    @ManyToOne @JoinColumn(name="idS")
    private Service service;

    
    public Employer () {
    }
    

	public Employer(int mat, String nom, String adress, String tell,
			String email, Date dateE, String prenom, String cIN, String photo,
			Date dateN, Employer res, Service service) {
		super(mat, nom, adress, tell, email, dateE);
		this.prenom = prenom;
		CIN = cIN;
		this.photo = photo;
		this.dateN = dateN;
		this.res = res;
		this.service = service;
	}


	public Date getDateN() {
		return dateN;
	}


	public void setDateN(Date dateN) {
		this.dateN = dateN;
	}


	public String getPrenom() {
		return prenom;
	}


	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}


	public String getCIN() {
		return CIN;
	}


	public void setCIN(String cIN) {
		CIN = cIN;
	}

	public String getPhoto() {
		return photo;
	}


	public void setPhoto(String photo) {
		this.photo = photo;
	}
	
	public Employer getRes() {
		return res;
	}
	public void setRes(Employer res) {
		this.res = res;
	}


	public Service getService() {
		return service;
	}


	public void setService(Service service) {
		this.service = service;
	}
	@Override
	public String toString() {
		return super.getNom()+ " " + prenom;
	}
}

